using System;
using System.Linq;
using Azure.Domain.Services;
using Azure.Infrastructure;
using Azure.Infrastructure.Azure;
using Microsoft.WindowsAzure;

namespace Azure.Web.Configuration
{
    public class Cloud : CommonRegistry
    {
        public Cloud()
        {
            For<IBlogConfiguration>()
                .Singleton()
                .Use<BlogConfiguration>();

            For<CloudStorageAccount>().Use(CloudStorageAccount.FromConfigurationSetting("DataConnectionString"));
            For(typeof (IRepository<>)).Use(typeof (AzureRepository<>));
            For(typeof(IQueue<>)).Use(typeof(AzureQueue<>));

            Scan(x =>
            {
                x.Assembly("Infrastructure");
                x.Assembly("Membership");
                x.Assembly("Domain");
                x.Assembly("Webby");
                x.ExcludeNamespace("Azure.Webby.Stubs");
                x.WithDefaultConventions();
             });
        }
    }
}